<template>
    <div class="detail">
        <div class="homedetail">
            <div class="detailimg">
                <img :src="info.coverImage" alt="">
            </div>
            <div class="info">
                <div style="font-weight: bold;font-size: 20px;">{{ info.title }}</div>
                <div>类型： <el-tag v-if="info.type == 1">课程教学</el-tag>
                    <el-tag v-if="info.type == 2">学术论文</el-tag>
                    <el-tag v-if="info.type == 3">科研项目</el-tag>
                    <el-tag v-if="info.type == 4">教学奖励</el-tag>
                    <el-tag v-if="info.type == 5">专利申请</el-tag>
                </div>
                <div>创作人：{{ info.createBy }}</div>
                <div> <el-button type="primary" plain size="mini"
                                @click="download(info.id, info.attachmentPath)"
                                style="margin-bottom: 10px;">下载附件</el-button></div>

            </div>
        </div>
        <div style="width: 70%;margin: 0 auto;" class="co" v-html="info.content"></div>

    </div>
</template>
<script>
import service from '@/request'

export default {
    data() {
        return {
            info: {},
            tableData: [],
        }
    },
    mounted() {
        this.getdetail()
    },
    methods: {
        detail(id) {


        },
        async download(id, f) {
            const res = await service.get("/achievement/download/" + id, { responseType: "blob" });
            console.log(res)
            window.location.href=f
        },
        async getdetail() {
            const res = await service.get("/achievement/" + this.$route.query.id);
            console.log(res)
            this.info = res.data
        },
        async getlist() {
            const res = await service.get("/hotal/typelist", {
                params: {
                    pageNum: 1,
                    pageSize: 1000,
                    hotelId: this.$route.query.id,

                    keyword: ""
                }
            });
            console.log(res);
            if (res.code == 200) {
                this.tableData = res.data.records;

            }

        }
    }


}
</script>

<style scoped>
.hotelitem {
    width: 20%;
    margin-right: 20px;

}

.hotellist {
    width: 50%;
    display: flex;
    margin: 20px auto;

    justify-content: flex-start;
    flex-wrap: wrap;
}
.co p img{
    width: 100%;
}
.info div {
    margin-bottom: 10px;
}

.detailimg img {
    width: 250px;
    height: 250px;
}

.detailimg {
    margin-right: 10px;
    width: 250px;
    height: 250px;
}

.homedetail {
    width: 50%;
    display: flex;
    margin: 0 auto;
}

.detail {
    width: 100%;
    overflow: auto;
    height: calc(100% - 60px);
    padding-top: 20px;
    box-sizing: border-box;

}
</style>